import myaxios from "../MyAxios";
import URLENV from "@/http/BaseUrl";
const BMDURL = URLENV.BMDURL;

const routeApi = {
  /**
   * 添加路线接口
   * @param {Object} params
   */
  add(params) {
    let url = BMDURL + "/route/add";
    return myaxios.post(url, params);
  },

  /**
   * 查询所有路线
   * @param {object} params
   */
  queryAllRoute(params) {
    let url = BMDURL + "/route";
    return myaxios.get(url, params);
  },

  /**
   * 查询所有路线类型
   */
  queryAllRouteTypes(params) {
    let url = BMDURL + "/route-types";
    return myaxios.get(url, params);
  },

  /**
   * 查询所有路线风景
   */
  queryAllRouteScenery(params) {
    let url = BMDURL + "/route-scenery";
    return myaxios.get(url, params);
  },

  /**
   * 通过type_id，查询详细路线
   * @param {Object} params {type_id: 1}
   */
  queryByTypeId(params) {
    return myaxios.get(BMDURL + "/route/typeId", params);
  },

  /**
   * 根据ID删除排片计划
   * @param {Object} params  {id:1}
   */
  delete(params) {
    return myaxios.post(BMDURL + "/plan/del", params);
  },

  /**
   * 发布排片计划
   * @param {Object} params  {id:1}
   */
  publish(params) {
    return myaxios.post(BMDURL + "/plan/publish", params);
  },

  /**
   * 将排片计划设置为未发布状态
   * @param {Object} params  {id:1}
   */
  noPublish(params) {
    return myaxios.post(BMDURL + "/plan/no-publish", params);
  },
};

export default routeApi;
